<template>
	<view class="item" @tap="itemClick">
		<view class="img">
			<image :src="item.main_image" class="auto-img img-radius"></image>
		</view>
		<view class="right-info">
			<view class="title">{{item.title}}</view>
			<view class="nums-block">
				<view class="nums">
					<span>¥</span>{{item.price/100}}
				</view>
				<view class="buy-img center">
					<image :src="buyIcon" class="auto-img"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
				 
				buyIcon: require('@/static/category/buy.png'),
			}
		},
		methods: {
			itemClick() {
				console.log('item',this.item)
				this.$emit('itemClick',this.item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 188rpx;
		margin: 6rpx 24rpx 40rpx 24rpx;
	}

	.img {

		flex: none;
		width: 188rpx;
		height: 188rpx;
		border-radius: 8rpx;
	}

	.right-info {
		flex: auto;
		margin-left: 16rpx;
		display: flex;
		flex-direction: column;
		height: 100%;
		// align-items: center;
		justify-content: flex-start;

		.title {
			margin-top: 10rpx;
			font-size: 30rpx;
			font-weight: 500;
			color: rgba(0, 0, 0, 1);
			height: 144rpx;
		}

		.nums-block {
			width: 100%;
			height: 44rpx;
			flex: none;
			display: flex;
			align-items: center;

			.nums {
				color: rgba(203, 60, 40, 1);
				flex: auto;
				font-size: 32rpx;

				span {
					font-size: 22rpx;
				}
			}

			.buy-img {
				flex: none;
				width: 44.19rpx;
				height: 44rpx;
				border-radius: 50%;

			}
		}
	}
</style>
